#coding=utf-8

import os
import pymssql

class DBCursorFactory(object):
	
	def __init__(self):
		pass
	
	@staticmethod
	def getConnection(sqlType, connectionInfo ):
		if sqlType=="mssql":
			return pymssql.connect(host=connectionInfo["server"], user=connectionInfo["user"], password=connectionInfo["password"], database=connectionInfo["database"],port = connectionInfo["port"]) 
		else:
			return pymssql.connect(host=connectionInfo["server"], user=connectionInfo["user"], password=connectionInfo["password"], database=connectionInfo["database"],port = connectionInfo["port"])
'''	
	@staticmethod		
	def getCursor( sqlType, connectionInfo ):
		conn = getConnection(sqlType,connectionInfo)
		return conn.cursor()
'''		
'''
	if __name__ == '__main__':
		try:
			
		
		except Exception as e:
			print "get DB connection error %s"%e
			sys.exit(-1)
			pass
'''